// JavaScript Document
function checkForm()
{
	if($('cat_name').value == ""){
	   alert("请填写分类名称！");   
	   $('cat_name').focus();
	   return(false);
   	}
}
//快速编辑排序
function edit_order(link_id, link_order)
{
	$('all_link_order_'+link_id).innerHTML = '<input type="text" value="'+link_order+'" id="link_order_'+link_id+'" size="3" onblur="show_order('+link_id+', this.value)">';
	$('link_order_'+link_id).focus();
}

function show_order(link_id, link_order)
{
	var _url = 'index.php?m=admin/category.changeOrder';	
	var _para = {};
	_para['link_id'] = link_id;
	_para['link_order'] = link_order;	
	var Ajax = new classAjax();
	Ajax.setRequest(_url, _para, function(data){
		var json = eval('['+data+']');
		var link_id = json[0]['link_id'];
		var link_order = json[0]['link_order'];
		var error = json[0]['error'];
		if(error == 1){
			alert('失败，请重试');
		} else {
			$('all_link_order_'+link_id).innerHTML = '<span id="order_'+link_id+'" onclick="edit_order('+link_id+', '+link_order+')" title="点击修改内容" style="">'+link_order+'</span>';
		}
	});		

}